﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace UCTT.Net
{
    public partial class FrmTestBinding : Form
    {
        /// <summary>
        /// 简易测试(非依赖注入)时这样写
        /// </summary>
        public FrmTestBinding()
        {
            InitializeComponent();
            testViewModelBindingSource.DataSource = testViewModelBindingSource.DataSource ?? new TestViewModel();
        }

        /// <summary>
        /// 依赖注入时这样写
        /// </summary>
        /// <param name="testViewModel"></param>
        public FrmTestBinding(TestViewModel testViewModel) : this()
        {
            testViewModelBindingSource.DataSource = testViewModel;
        }
    }
}